using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NHibernate;

namespace NDomain.ExampleModels.BloggingSystem.Web
{
    public partial class Default : System.Web.UI.Page
    {
        private IBlogRepository blogRepository;
        private IBlogFactory blogFactory;
      
        protected void Page_Load(object sender, EventArgs e)
        {
            UpdateGridView1();
        }

        private void UpdateGridView1()
        {
            GridView1.DataSource = blogRepository;
            GridView1.DataBind();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            blogRepository.Add(blogFactory.CreateBlog(TextBox1.Text));
            UpdateGridView1();
        }
    }
}
